package cn.uyunsky.platform.taglib;

import java.text.SimpleDateFormat;

public class DatepickerInputTag extends BaseInputTag {

    private static final long serialVersionUID = 1L;
    private static String STYLE_CLASS = "uyunsky_date";

    private boolean showdate = false;

    public void setShowdate(boolean showdate) {
        this.showdate = showdate;
    }

    public DatepickerInputTag() {
    }

    protected String prepareOtherClass() {
        return STYLE_CLASS;
    }

    protected void prepareOtherAttributes(StringBuffer results) {
        prepareAttribute(results, "type", "text");
        if (showdate) {
            String date = new SimpleDateFormat("yyyy-MM-dd").format(new java.util.Date());
            this.prepareAttribute(results, "value", date);
        }
    }

}
